1 package jrre.instructionset.push.localvariables;
2
3 import jrre.Stack;
4
5 public class ALoad extends jrre.instructionset.Instruction {
6
7 private int operand;
8
9 public ALoad(int operand){
10
11 this.operand = operand;
12
13 name = "aload";
14 description = "The index is an unsigned byte that must be an index "+
15 "into the local variable array of the current frame. "+
16 "The local variable at index must contain an object "+
17 "reference. The objectref in the local variable at "+
18 "index is pushed onto the operand stack.";
19 length = 1;
20 }
21
22 /***
23 * Gets the Operand.
24 */
25 public int getOperand(){
26 return this.operand;
27 }
28
29 /***
30 * Sets the Operand.
31 * @param Operand The value to set it to.
32 */
33 public void setOperand(int operand){
34 this.operand = operand;
35 }
36
37 /***
38 * Executes the <strong><code>aload</code></strong> instruction.
39 *
40 * @param operandStack
41 */
42 public void execute(){
43
44 Stack.pushOperand(Stack.getLocalVariable(operand));
45 }
46
47 public String toString(){
48 StringBuffer toReturn = new StringBuffer();
49 toReturn.append("aload ");
50 toReturn.append(Integer.toHexString(operand));
51
52 return toReturn.toString();
53 }
54 }
This page was automatically generated by Maven